<style type="text/css">
#ar{
    position:absolute;
    top:5px;
    right:0px;
    border:6px inset #b0b5bd;
    text-align:center;
    color:#000066;
    background-color:#d0d6df;
    cursor:move;
    height:50px;
    width:340px;
}
</style>
<div id="ar"></div>
<br><br>
<?php echo CYui::init(true, true); $ajax = CYui::buildAjaxOptions('/widget/ajaxcall', 'ar'); ?>
<h2>Calendar Demo</h2>
<br><br>
<div class="yiiForm">
    <?php echo CHtml::beginForm(); ?>
    <table class="dataGrid">
    <tr>
        <td align="center">
            <?php echo CYui::calendar('date1', $value1, 'Birth Day', CYui::DEFAULT_DATE_FORMAT, 1, $ajax); ?>
        </td>
        <td valign="top" align="center"><br><?php echo CYui::inputCalendar('date2', $value2, 'Select date', CYui::DEFAULT_DATE_FORMAT, 2, $ajax); ?></td>
        <td align="center" valign="top"><br><?php echo CYui::buttonCalendar('date3', $value3, "%Y-%m-%d", 1, $ajax); ?></td>
    </tr>
    </table>
    <br><br>
    <div class="action">
        <?php echo CHtml::submitButton('Post'); ?>
    </div>
    <br>
    <?php echo CHtml::endForm(); ?>
</div><!-- yiiForm -->
<br><br>
<table class="dataGrid">
    <tr>
        <th colspan="4"><h3>Calendar,<br>inputCalendar</h3></th>
    </tr>
    <tr>
        <th>Param</th>
        <th>Type</th>
        <th>Description</th>
        <th>Required / default</th>
    </tr>
    <tr>
        <td><b>$name</b></td>
        <td>string</td>
        <td>DOM name</td>
        <td align="center">+</td>
    </tr>
    <tr>
        <td><b>$value</b></td>
        <td>string</td>
        <td>start value for DOM element</td>
        <td align="center">current date</td>
    </tr>
    <tr>
        <td><b>$label</b></td>
        <td>string</td>
        <td>calendar caption</td>
        <td align="center">empty</td>
    </tr>
    <tr>
        <td><b>$formatStr</b></td>
        <td>string</td>
        <td>date format string</td>
        <td align="center">"%d.%m.%Y"<br>see CYui::DEFAULT_DATE_FORMAT</td>
    </tr>
    <tr>
        <td><b>$monthsVisible</b></td>
        <td>integer</td>
        <td>visible months count</td>
        <td align="center">1</td>
    </tr>
    <tr>
        <td><b>$ajax</b></td>
        <td>array</td>
        <td>ajax call when select new value for widget</td>
        <td align="center">NULL</td>
    </tr>
    <tr>
        <td colspan="4" align="center">
            <?php echo CYui::codeHighlight(' echo CYui::calendar(`birthDay`, $user->birthDay, `Birth Day`);', 'php'); ?>
            <?php echo CYui::codeHighlight(' echo CYui::inputCalendar(`date2`, $date2, `Select date`);', 'php'); ?>
        </td>
    </tr>
    <tr>
        <td colspan="4">
            <h4>The Calendar localization based on <tt>Yii::app()->language</tt>.<br>
                Now autorecognize English, Russian, Ukrainian.
                For other languages append localize array to CYui source.
            </h4>
        </td>
    </tr>
</table>
<br>
<table class="dataGrid">
    <tr>
        <th colspan="4"><h3>buttonCalendar</h3></th>
    </tr>
    <tr>
        <th>Param</th>
        <th>Type</th>
        <th>Description</th>
        <th>Required / default</th>
    </tr>
    <tr>
        <td><b>$name</b></td>
        <td>string</td>
        <td>DOM name</td>
        <td align="center">+</td>
    </tr>
    <tr>
        <td><b>$value</b></td>
        <td>string</td>
        <td>start value for DOM element</td>
        <td align="center">current date</td>
    </tr>
    <tr>
        <td><b>$formatStr</b></td>
        <td>string</td>
        <td>date format string</td>
        <td align="center">"%d.%m.%Y"<br>see CYui::DEFAULT_DATE_FORMAT</td>
    </tr>
    <tr>
        <td><b>$monthsVisible</b></td>
        <td>integer</td>
        <td>visible months count</td>
        <td align="center">1</td>
    </tr>
    <tr>
        <td><b>$ajax</b></td>
        <td>array</td>
        <td>ajax call when select new value for widget</td>
        <td align="center">NULL</td>
    </tr>
    <tr>
        <td colspan="4" align="center">
            <?php echo CYui::codeHighlight(' echo CYui::button(`btnCal`, $user->birthDay, `%Y-%m-%d`);', 'php'); ?>
        </td>
    </tr>
    <tr>
        <td colspan="4">
            <h4>The Calendar localization based on <tt>Yii::app()->language</tt>.<br>
                Now autorecognize English, Russian, Ukrainian.
                For other languages append localize array to CYui source.
            </h4>
        </td>
    </tr>
</table>